package Demo08;
//圆周率  Math.PI

public class Demo03Math {
    public static void main(String[] args) {
        //取绝对值
        System.out.println(Math.abs(0.2));
        System.out.println(Math.abs(-33));
        System.out.println("====================");

        //向上取整
        System.out.println(Math.ceil(3.9));
        System.out.println(Math.ceil(3.01));
        System.out.println(Math.ceil(3.0));
        System.out.println(Math.ceil(-3.3));
        System.out.println("======================");

        //向下取整
        System.out.println(Math.floor(3.9));
        System.out.println(Math.floor(3.0));
        System.out.println(Math.floor(-3.5));
        System.out.println("=====================");

        //四舍五入
        System.out.println(Math.round(20.4));
        System.out.println(Math.round(20.5));
        System.out.println(Math.round(-22.2));

    }
}
